<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    
    function Parent(m){
        this.msg = m;
    }
    Parent.prototype.show = function(){
        console.log(this.msg)
    }
    Parent.prototype.init = function(){
        console.log("init")
    }

    function Child(){}

    Child.prototype = new Parent("world");
    
    Child.prototype.init = function(){
        console.log("child 的 init");
    }

    const p = new Parent("hello");
    console.log(p);
    // console.log(p.__proto__)
    p.show()
    p.init();
    // 初始原型链关系
    // p.__proto__   --->  Parent.prototype ---->  Parent.prototype.__proto__  --->  Object.prototype


    const c = new Child();
    console.log(c);
    c.show()
    c.init();

    // 原型链继承之后的原型链关系
    // c.__proto__  --->   p.__proto__   --->  Parent.prototype ---->  Parent.prototype.__proto__  --->  Object.prototype



   
    // =========

    // 多继承


    


</script>
</html>